package com.agentai.framework.satoken.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 用户信息
 *
 */
@Data
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class MpLoginUser implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "登录名")
    private String username;
    @Schema(description = "密码")
    private Integer password;
    @Schema(description = "真实姓名")
    private String realName;
    @Schema(description = "用户手机号")
    private String mobile;
    @Schema(description = "性别   0：男   1：女   2：未知")
    private Integer gender;
    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "机构ID")
    private Long orgId;

    @Schema(description = "状态  0：停用   1：正常")
    private Integer status;
    @Schema(description = "超级管理员   0：否   1：是")
    private Integer superAdmin;
    @Schema(description = "租户ID")
    private Long tenantId;

    /**
     * 获取登录id
     */
    public String getLoginId() {

        if (userId == null) {
            throw new IllegalArgumentException("用户ID不能为空");
        }
        return ""+ userId;
    }

}
